package com.zz.webapp.model;

import com.zz.webapp.dto.UserDto;
import lombok.Data;

import java.io.Serializable;

@Data
public class User implements Serializable{
    private static final long serialVersionUID = -2071209708902726310L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 密码
     */
    private String password;

    /**
     * 年龄
     */
    private Integer age;

    public User(){}
    public User(String userName,String password ,Integer age){
        this.userName = userName;
        this.password = password;
        this.age = age;
    }
    public User(UserDto userDto){
        this.userName = userDto.getUserName();
        this.password = userDto.getPassword();
        this.age = userDto.getAge();
    }
}